<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>Document</title>
</head>
<body>
    <%= title %>
    <button id="btn">登出</button>
</body>
</html>
<script src="/javascripts//jquery-1.11.1.min.js"></script>
<script>
  $('#btn').on('click',function(){
      $.ajax({
        url:'/api/useLoginOut',
        type:'get',
        dataType:'json',
        success:function(data){
          console.log(data)
          if(data.code == 0){
            alert(data.msg)
            window.location.href = '/login'
          }
        }
      })
  })
</script>